package pattern.factory.simple;

import pattern.factory.Beer;
import pattern.factory.Qindao;
import pattern.factory.Xuehua;

/**
 * Created by Nelson on 7/3/2018.
 */
public class SimpleFactory {
    public Beer getBeer(String name){
          if (name.equals("Qindao")){
              return new Qindao();
          }else if  (name.equals("Xunhua")){
              return new Xuehua();
          }else{
              System.out.println("??????????");
              return null;
          }

    }
}
